import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import store from './store'
// 富文本
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
// eachret
// import * as echarts from 'echarts'
// Vue.prototype.$echarts = echarts
//我的自定义组件
import MyBread from '@/components/overall_situation/BreadCrumb.vue'
Vue.component('my-bread', MyBread)

import TreeTable from 'vue-table-with-tree-grid'
// 导入全局css样式表
import './assets/css/global.css'
// 图标
import './assets/font_ofggublwxnp/iconfont.css'
import './assets/fonts/iconfont.css'
// axios
import axios from 'axios'
Vue.component('tree-table', TreeTable)

Vue.prototype.$http = axios
axios.interceptors.request.use((consfig) => {
  consfig.headers.Authorization = window.sessionStorage.getItem('token')
  // token 写到请求头里面，用作请求的权限
  // console.log(consfig)
  return consfig
})
Vue.filter('dataFormat', function (originVal) {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + 1 + '').padStart(2, '0')

  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
// 注册富文本为vue全局
Vue.use(VueQuillEditor /* { default global options } */)
axios.defaults.baseURL = 'http://43.138.104.150:8888/api/private/v1/'

Vue.config.productionTip = true

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app')
